package com.zhengxyou.jetpackdemo;

import android.os.Bundle;
import android.view.View;

import com.zhengxyou.jetpackdemo.butterknife.ButterKnifeActivity;
import com.zhengxyou.jetpackdemo.daggerDemo.DaggerActivity;
import com.zhengxyou.jetpackdemo.dataBinding.DataBindingActivity;
import com.zhengxyou.jetpackdemo.greenDao.GreenDaoActivity;
import com.zhengxyou.jetpackdemo.jobScheduer.JobScheduerActivity;
import com.zhengxyou.jetpackdemo.lifecycle_liveData_viewModel.LifecycleLiveDataViewModelActivity;
import com.zhengxyou.jetpackdemo.mvvm.MVVMActivity;
import com.zhengxyou.jetpackdemo.navigation.Main2Activity;
import com.zhengxyou.jetpackdemo.navigation.Main3Activity;
import com.zhengxyou.jetpackdemo.navigation.NavigationActivity;
import com.zhengxyou.jetpackdemo.paging.PagingActivity;
import com.zhengxyou.jetpackdemo.room.RoomActivity;
import com.zhengxyou.jetpackdemo.work.WorkActivity;

import androidx.appcompat.app.AppCompatActivity;

/**
 * 官方例子@see https://github.com/googlesamples/android-architecture-components
 * https://github.com/googlesamples/android-architecture
 */
public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.btn_lifecycle).setOnClickListener(this);
        findViewById(R.id.btn_room).setOnClickListener(this);
        findViewById(R.id.btn_paging).setOnClickListener(this);
        findViewById(R.id.btn_nav).setOnClickListener(this);
        findViewById(R.id.btn_nav_bottom).setOnClickListener(this);
        findViewById(R.id.btn_nav_draw).setOnClickListener(this);
        findViewById(R.id.btn_work).setOnClickListener(this);
        findViewById(R.id.btn_jobs).setOnClickListener(this);
        findViewById(R.id.btn_dataBind).setOnClickListener(this);
        findViewById(R.id.btn_butterKnife).setOnClickListener(this);
        findViewById(R.id.btn_mvvm).setOnClickListener(this);
        findViewById(R.id.btn_dagger).setOnClickListener(this);
        findViewById(R.id.btn_greenDao).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_greenDao:
                GreenDaoActivity.start(this);
                break;
            case R.id.btn_dagger:
                DaggerActivity.start(this);
                break;
            case R.id.btn_mvvm:
                MVVMActivity.start(this);
                break;
            case R.id.btn_lifecycle:
                LifecycleLiveDataViewModelActivity.start(this);
                break;
            case R.id.btn_room:
                RoomActivity.start(this);
                break;
            case R.id.btn_paging:
                PagingActivity.start(this);
                break;
            case R.id.btn_nav:
                NavigationActivity.start(this);
                break;
            case R.id.btn_nav_bottom:
                Main2Activity.start(this);
                break;
            case R.id.btn_nav_draw:
                Main3Activity.start(this);
                break;
            case R.id.btn_work:
                WorkActivity.start(this);
                break;
            case R.id.btn_jobs:
                JobScheduerActivity.start(this);
                break;
            case R.id.btn_dataBind:
                DataBindingActivity.start(this);
                break;
            case R.id.btn_butterKnife:
                ButterKnifeActivity.start(this);
                break;
        }
    }
}
